`summarise()` has grouped output by 'test_description'. You can override using
the `.groups` argument.
test_description
Frequent Tools
n
CAARS-S:L
CAARS
5
ASRS-A
ASRS
4
BAARS-IV
BAARS
3
ASRS-v1.1
ASRS
2
CAARS-S
CAARS
2
ADHD-items
Other
1
ADSA
Other
1
AHA
Other
1
ALS-SF
Other
1
APQ
Other
1
ASRS
ASRS
1
ASRS-5
ASRS
1
ASSET-BS
Other
1
BADDS
Other
1
CAARS-AI
CAARS
1
CAARS-S:SV
CAARS
1
CBS
Other
1
EarlyDetect(ASRS)
Other
1
IPDE-SQ-11
Other
1
Online
Other
1
PAI
Other
1
PDI-4
Other
1
SR-WRAADDS
Other
1
WURS
WURS
1
WURS-25
WURS
1
WURS-4
WURS
1
WURS-61
WURS
1
WURS/CAARS
WURS
1
# 1. Define your colors in a named vector# You must assign a color to every category, or the others will disappear/turn grey.my_colors <-c("ASRS"="red", # Replace with your preferred color"CAARS"="blue", # Replace with your preferred color"BAARS"="darkgreen", # Replace with your preferred color"WURS"="brown4", # Replace with your preferred color"Other"="black"# The specific requirement)# 2. Plotggplot2::ggplot(data = plot_data, aes(x = sensitivity,y = specificity,shape = Neurotypical_Only,size = size,color =`Frequent Tools` )) +geom_point() +# 3. Add the manual scalescale_color_manual(values = my_colors) +xlab("Sensitivity (%)") +ylab("Specificity (%)") + ggrepel::geom_text_repel(aes(label = test_description), max.overlaps =10, size =3) +labs(shape ="Neurotypical only" ) +scale_size_continuous(name ="Size", # This sets the legend titlebreaks =c(50, 500, 1000), # Original untransformed values for legendlabels =c("50", "500", "1000"), # Corresponding labelsguide ="legend", # Explicitly request a legend# Set limits based on the *transformed* size values from your plot_data# This is crucial for the scale to match your actual plotted points ) +theme(legend.position ="right") +xlim(c(0, 100)) +ylim(c(0, 100))
# Function to read CSV and select specific columnsread_adhd_data <-function(file_path) {# Read the CSV file data <-read.csv(file_path)# Select only the required columns clean_data <- data %>%select(n_ADHD, sensitivity_self_report, specificity_self_report, size, ID)return(clean_data)}########################### Usage exampleaccuracy <-read_adhd_data(data_location)############################## Check the resulthead(accuracy)
n_ADHD sensitivity_self_report specificity_self_report size
1 518 NA NA 845
2 38 NA NA 69
3 142 92 NA 280
4 1006 NA NA 1135
5 63 89 13 69
6 70 81 71 140
ID
1 Abramson, 2023{#5}
2 Adamou, 2022{#8}
3 Aita, 2018{#16}
4 Amen, 2021{#28}
5 Bakare, 2020{#45}
6 Bastiaens, 2017{#55}
n_ADHD sensitivity_self_report specificity_self_report size
1 518 NA NA 845
2 38 NA NA 69
3 142 92 NA 280
4 1006 NA NA 1135
5 63 89 13 69
6 70 81 71 140
ID Prevalence One_Minus_Prevalence Sensitivity Specificity
1 Abramson, 2023{#5} 0.6130178 0.38698225 NA NA
2 Adamou, 2022{#8} 0.5507246 0.44927536 NA NA
3 Aita, 2018{#16} 0.5071429 0.49285714 92 NA
4 Amen, 2021{#28} 0.8863436 0.11365639 NA NA
5 Bakare, 2020{#45} 0.9130435 0.08695652 89 13
6 Bastiaens, 2017{#55} 0.5000000 0.50000000 81 71
Accuracy
1 NA
2 NA
3 NA
4 NA
5 82.3913
6 76.0000
accuracy <- accuracy %>%select(-Sensitivity, -Specificity)# Create and save in one pipe chainoutput_file <-"accuracy.html"# Create and savekableExtra::kbl(accuracy) %>%kable_styling(bootstrap_options =c("striped", "hover")) %>%save_kable(file = output_file)
Warning: There was 1 warning in `dplyr::mutate()`.
ℹ In argument: `admin_combination = as.numeric(admin_combination)`.
Caused by warning:
! NAs introduced by coercion
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in max(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "kappa_combination"
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "ICC_combination"
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "cost_combination"
Warning: There was 1 warning in `dplyr::mutate()`.
ℹ In argument: `cost_combination = as.numeric(cost_combination)`.
Caused by warning:
! NAs introduced by coercion
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in max(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "concordance_combination"
Warning: There was 1 warning in `dplyr::mutate()`.
ℹ In argument: `concordance_combination = as.numeric(concordance_combination)`.
Caused by warning:
! NAs introduced by coercion
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in max(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "cost_self.report"
Warning: There was 1 warning in `dplyr::mutate()`.
ℹ In argument: `cost_self.report = as.numeric(cost_self.report)`.
Caused by warning:
! NAs introduced by coercion
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in max(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
Warning: There was 1 warning in `dplyr::mutate()`.
ℹ In argument: `admin_peer_rating = as.numeric(admin_peer_rating)`.
Caused by warning:
! NAs introduced by coercion
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in max(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "kappa_peer_rating"
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "ICC_peer_rating"
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "cost_peer_rating"
Warning: There was 1 warning in `dplyr::mutate()`.
ℹ In argument: `cost_peer_rating = as.numeric(cost_peer_rating)`.
Caused by warning:
! NAs introduced by coercion
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in max(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "concordance_peer_rating"
Warning: There was 1 warning in `dplyr::mutate()`.
ℹ In argument: `concordance_peer_rating = as.numeric(concordance_peer_rating)`.
Caused by warning:
! NAs introduced by coercion
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in max(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
Warning: There was 1 warning in `dplyr::mutate()`.
ℹ In argument: `admin_neuroimaging = as.numeric(admin_neuroimaging)`.
Caused by warning:
! NAs introduced by coercion
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in max(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "kappa_neuroimaging"
[1] "ICC_neuroimaging"
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "cost_neuroimaging"
Warning: There was 1 warning in `dplyr::mutate()`.
ℹ In argument: `cost_neuroimaging = as.numeric(cost_neuroimaging)`.
Caused by warning:
! NAs introduced by coercion
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in max(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "concordance_neuroimaging"
Warning: There was 1 warning in `dplyr::mutate()`.
ℹ In argument: `concordance_neuroimaging =
as.numeric(concordance_neuroimaging)`.
Caused by warning:
! NAs introduced by coercion
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in max(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
Warning: There was 1 warning in `dplyr::mutate()`.
ℹ In argument: `admin_EEG = as.numeric(admin_EEG)`.
Caused by warning:
! NAs introduced by coercion
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in max(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "kappa_EEG"
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "ICC_EEG"
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "cost_EEG"
Warning: There was 1 warning in `dplyr::mutate()`.
ℹ In argument: `cost_EEG = as.numeric(cost_EEG)`.
Caused by warning:
! NAs introduced by coercion
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in max(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "concordance_EEG"
Warning: There was 1 warning in `dplyr::mutate()`.
ℹ In argument: `concordance_EEG = as.numeric(concordance_EEG)`.
Caused by warning:
! NAs introduced by coercion
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in max(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
Warning: There was 1 warning in `dplyr::mutate()`.
ℹ In argument: `admin_biomarker = as.numeric(admin_biomarker)`.
Caused by warning:
! NAs introduced by coercion
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in max(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "kappa_biomarker"
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "ICC_biomarker"
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "cost_biomarker"
Warning: There was 1 warning in `dplyr::mutate()`.
ℹ In argument: `cost_biomarker = as.numeric(cost_biomarker)`.
Caused by warning:
! NAs introduced by coercion
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in max(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "concordance_biomarker"
Warning: There was 1 warning in `dplyr::mutate()`.
ℹ In argument: `concordance_biomarker = as.numeric(concordance_biomarker)`.
Caused by warning:
! NAs introduced by coercion
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in max(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "clinical_misdiagnosis_observational"
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "sensitivity_observational"
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "specificity_observational"
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "admin_observational"
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "kappa_observational"
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "ICC_observational"
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "cost_observational"
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "concordance_observational"
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
Warning: There was 1 warning in `dplyr::mutate()`.
ℹ In argument: `admin_clinician_interview =
as.numeric(admin_clinician_interview)`.
Caused by warning:
! NAs introduced by coercion
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in max(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "kappa_clinician_interview"
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "ICC_clinician_interview"
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "cost_clinician_interview"
Warning: There was 1 warning in `dplyr::mutate()`.
ℹ In argument: `cost_clinician_interview =
as.numeric(cost_clinician_interview)`.
Caused by warning:
! NAs introduced by coercion
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in max(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "concordance_clinician_interview"
Warning: There was 1 warning in `dplyr::mutate()`.
ℹ In argument: `concordance_clinician_interview =
as.numeric(concordance_clinician_interview)`.
Caused by warning:
! NAs introduced by coercion
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in max(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "clinical_misdiagnosis_clinician_tool"
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "sensitivity_clinician_tool"
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "specificity_clinician_tool"
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "admin_clinician_tool"
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "kappa_clinician_tool"
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "ICC_clinician_tool"
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "cost_clinician_tool"
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "concordance_clinician_tool"
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
Warning: There was 1 warning in `dplyr::mutate()`.
ℹ In argument: `admin_feigningADHD = as.numeric(admin_feigningADHD)`.
Caused by warning:
! NAs introduced by coercion
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in max(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "kappa_feigningADHD"
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "ICC_feigningADHD"
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "cost_feigningADHD"
Warning: There was 1 warning in `dplyr::mutate()`.
ℹ In argument: `cost_feigningADHD = as.numeric(cost_feigningADHD)`.
Caused by warning:
! NAs introduced by coercion
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in max(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
[1] "concordance_feigningADHD"
Warning: There was 1 warning in `dplyr::mutate()`.
ℹ In argument: `concordance_feigningADHD =
as.numeric(concordance_feigningADHD)`.
Caused by warning:
! NAs introduced by coercion
Warning in min(d_now[[test_outcome_and_result]]): no non-missing arguments to
min; returning Inf
Warning in max(d_now[[test_outcome_and_result]]): no non-missing arguments to
max; returning -Inf
#d$test_description_self_report <-word(d$test_description_self, 1)d$test_description_peer_rating <- d$test_description_peer# If you want to clean up any trailing spaces left behind:d <- d %>% dplyr::mutate(study =gsub("\\{.*\\}", "", ID),study =trimws(study),study =ifelse(study =="van de Glind, 2013", "Van de Glind, 2013", study),test_description_self_report = test_description_self )